﻿@model WebVideo.EntityAdmin

@{
    ViewBag.Title = "Login to Admin";
    //Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login Page - 2012/2013</title>

 <link href="@Url.Content("~/Content/cssAdmin/css/style.css")" rel="stylesheet" type="text/css" />
  <script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-1.7.min.js")" type="text/javascript"></script>
  <script src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>


<script type="text/javascript">
    $(document).ready(function () {
        $('.loginform button').hover(function () {
            $(this).stop().switchClass('default', 'hover');
        }, function () {
            $(this).stop().switchClass('hover', 'default');
        });

        $('#login').submit(function () {
            return false;
        });

        $('#Username').keypress(function () {
            jQuery('.loginerror').slideUp();
        });
    });

    function checkId() {

        var Username = $('#Username').val();
        var Pass = $('#Pass').val();

        var postURL = '@Url.Action("CheckId", "Login")';
         //         $.post("/Admin/Login/CheckId", { "Username": Username, "Pass": Pass }, function (data) {
         $.post(postURL, { "Username": Username, "Pass": Pass }, function (data) {
             if (data.Id == " ") // ko dung pass hoac user
             {
                 jQuery('.loginerror').slideDown();
                 u.focus();
                 return false;
             }
             else {

                 window.location.href = "@Url.Action("Index","Home")"; 

             }
            });
     };

</script>
<!--[if lt IE 9]>
	<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
<![endif]-->
</head>

<body class="login">

<div class="loginbox radius3">
	<div class="loginboxinner radius3">
    	<div class="loginheader">
    		<h1 class="bebas">Sign In</h1>
        	<div class="logo"><img src="@Url.Content("~/Content/cssAdmin/images/logo_Khai_Nguyen.png")" alt="" /></div>
    	</div><!--loginheader-->
        
        <div class="loginform">
        	<div class="loginerror"><p>Invalid Username or Pass</p></div>
        	<form id="login" action="" method="post">
            	<p>
                	<label for="Username" class="bebas">Username</label>
                    <input type="text" id="Username" name="Username" class="radius2" />
                </p>
                <p>
                	<label for="Pass" class="bebas">Pass</label>
                    <input type="password" id="Pass" name="Pass" class="radius2" />
                </p>
                <p>
                	@using (Html.BeginForm())
                    {
                        <button class="radius3 bebas" id="checkid" onclick="checkId()">Sign in</button>
                    
                    }
                </p>
             @*  <p><a href="#" id="test">Can't access your account?</a></p>*@
            </form>
        </div><!--loginform-->
    </div><!--loginboxinner-->
</div><!--loginbox-->

</body>

</html>